return new_layout;
}
+/**
+ * gdk_popup_layout_equal:
+ * @layout: a #GdkPopupLayout
+ * @other: another #GdkPopupLayout
+ *
+ * Check whether @layout and @other has identical layout properties.
+ *
+ * Returns: %TRUE if @layout and @other have identical layout properties,
+ * otherwise %FALSE.
+ */
+gboolean
+gdk_popup_layout_equal (GdkPopupLayout *layout,
+ GdkPopupLayout *other)
+{
+ g_return_val_if_fail (layout, FALSE);
+ g_return_val_if_fail (other, FALSE);
+
+ return (gdk_rectangle_equal (&layout->anchor_rect, &other->anchor_rect) &&
+ layout->rect_anchor == other->rect_anchor &&
+ layout->surface_anchor == other->surface_anchor &&
+ layout->anchor_hints == other->anchor_hints &&
+ layout->dx == other->dx &&
+ layout->dy == other->dy);
+}
+
/**
* gdk_popup_layout_set_anchor_rect:
* @layout: a #GdkPopupLayout
GDK_AVAILABLE_IN_ALL
GdkPopupLayout * gdk_popup_layout_copy (GdkPopupLayout *layout);
+GDK_AVAILABLE_IN_ALL
+gboolean gdk_popup_layout_equal (GdkPopupLayout *layout,
+ GdkPopupLayout *other);
+
GDK_AVAILABLE_IN_ALL
void gdk_popup_layout_set_anchor_rect (GdkPopupLayout *layout,
const GdkRectangle *anchor_rect);
}
else
{
+ if (impl->popup.unconstrained_width == width &&
+ impl->popup.unconstrained_height == height &&
+ gdk_popup_layout_equal (impl->popup.layout, layout))
+ return TRUE;
+
reposition_popup (surface, width, height, layout);
}